<template>
    <div class="content">
        <img class="advertisement"
            src="https://yanxuan.nosdn.127.net/static-union/1679558973e8f3ba.jpg?quality=75&type=webp&imageView&thumbnail=0x196"
            alt="">
        <router-link :to="{ name: 'b1-detail', params: { id: this.categoryId, subCategoryId: this.subCategoryId } }">
            <img class="content-img" :src="this.img" alt="">
        </router-link>

        <p>{{ this.name }}</p>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            img: '',
            name: '',
            categoryId: 11,
            subCategoryId: 9999954706610
        };
    },
    async created() {
        try {
            const res = await axios.get('/item/cateList.json?csrf_token=488a4e0e372cb731535522b4baf07040&__timestamp=1682772298892&categoryId=11')
            const arr = res.data.data.categoryL2List[0];
            this.img = arr.bannerUrl;
            this.name = arr.name;
        } catch (error) {
            console.error(error);
        }

    }
};
//9999954706610
//https://m.you.163.com/item/list.json?csrf_token=488a4e0e372cb731535522b4baf07040&__timestamp=1682844150830&categoryId=11&subCategoryId=9999954706610&categoryType=0
//https://m.you.163.com/item/list.json?csrf_token=488a4e0e372cb731535522b4baf07040&__timestamp=1682844664445&categoryId=1005000&subCategoryId=109342055&categoryType=0
</script>

<style>
.content {
    flex: 1;
    padding: 15px 15px 10px 15px;
    width: 100%;
}

.advertisement {
    width: 100%;
    max-height: 96px;
}

.content-img {
    height: 72px;
    width: 72px;
}
</style>